//
//  NSMutableArray+extension.m
//  YouKuDylib
//
//  Created by iMac on 2018/7/17.
//

#import "NSMutableArray+extension.h"
#import <objc/runtime.h>

@implementation NSMutableArray (extension)
+ (void)load
{
	static dispatch_once_t onceToken;
	dispatch_once(&onceToken, ^{
		Method method1 = class_getInstanceMethod(NSClassFromString(@"__NSArrayM"), @selector(insertObject:atIndex:));
		Method method2 = class_getInstanceMethod(NSClassFromString(@"__NSArrayM"), @selector(yty_insertObject:atIndex:));
		method_exchangeImplementations(method1, method2);
	});
}

- (void)yty_insertObject:(id)anObject atIndex:(NSUInteger)index
{
	if (anObject == nil) return;
	[self yty_insertObject:anObject atIndex:index];
}
@end
